<?php
/**
 * Pert Library
 * Cart Class
 *
 * @author	Emre Hasegeli <hasegeli@gmail.com>
 * @license	GNU General Public License v3
 */

namespace Pert;

class Iterator implements \Iterator
{
	private $offsetArray;

	public function __Construct(Array $offsetArray)
	{
		$this->offsetArray = $offsetArray;
	}

	public function Rewind()
	{
		reset($this->offsetArray);
	}

	public function Current()
	{
        return current($this->offsetArray);
	}

	public function Key()
	{
		return key($this->offsetArray);
	}

	public function Next()
	{
		return next($this->offsetArray);
	}

	public function Valid()
	{
        return $this->Current() !== false;
	}
}
